import CryptoJS from 'crypto-js';

export function encode(value: string): string {
  const decodedString = CryptoJS.enc.Base64.parse(value).toString(CryptoJS.enc.Utf8);
  return decodedString;
}

export function getUrlParam(name: string): string | null {
  const hash = window.location.hash;
  const paramStr = hash.substring(hash.indexOf('?') + 1);
  const params = new URLSearchParams(paramStr);
  return params.get(name);
}
